'use strict'
// Template version: 1.2.3
// see http://vuejs-templates.github.io/webpack for documentation.

const path = require('path')

module.exports = {
  dev: {

    // Paths
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {
      '/api': {
        target: 'http://localhost:5001',  // 这里后台的地址模拟的;应该填写你们真实的后台接口
        changOrigin: true,// 允许跨域
        pathRewrite: {
          '^/api': '/apisell'
        }
      }
    },
    // Various Dev Server settings
    host: '0.0.0.0', // can be overwritten by process.env.HOST
    port: 9000, // can be overwritten by process.env.HOST, if port is in use, a free one will be determined
    autoOpenBrowser: false,
    errorOverlay: true,
    notifyOnErrors: true,
    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-

    // Use Eslint Loader?
    // If true, your code will be linted during bundling and
    // linting errors and warnings will be shown in the console.
    useEslint: true,
    // If true, eslint errors and warnings will also be shown in the error overlay
    // in the browser.
    showEslintErrorsInOverlay: false,

    /**
     * Source Maps
     */

    // https://webpack.js.org/configuration/devtool/#development
    devtool: 'eval-source-map',

    // If you have problems debugging vue-files in devtools,
    // set this to false - it *may* help
    // https://vue-loader.vuejs.org/en/options.html#cachebusting
    cacheBusting: true,

    // CSS Sourcemaps off by default because relative paths are "buggy"
    // with this option, according to the CSS-Loader README
    // (https://github.com/webpack/css-loader#sourcemaps)
    // In our experience, they generally work as expected,
    // just be aware of this issue when enabling this option.
    cssSourceMap: false,
    sellUrl: "http://leiyun.site/sell",  // 随机生成的域名，需要经常更新
    openidUrl: "http://cqzwsf.nat300.top/apisell/wechat/authorize",
    wechatPayUrl: "http://cqzwsf.nat300.top/apisell/pay/create",
    wsUrl: "ws://127.0.0.1:5001/apisell/webSocketBuyer/",
  },
  
  build: {
    //  ?openid=oqS4U6pDmDCEZsP3MJGrwOT6WSYs
    index: path.resolve(__dirname, '../dist/index.html'),
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '',

    host: '0.0.0.0', // 
    //port: 9001, // 
    proxyTable: {},
    productionSourceMap: true,
    // https://webpack.js.org/configuration/devtool/#production
    devtool: '#source-map',
    productionGzip: false,
    productionGzipExtensions: ['js', 'css'],
    sellUrl: "http://leiyun.site/sell",  // 随机生成的域名，需要经常更新
    openidUrl: "http://leiyun.site/apisell/wechat/authorize",
    wechatPayUrl: "http://leiyun.site/apisell/pay/create",
    wsUrl: "ws://leiyun.site/apisell/webSocketBuyer/",
    bundleAnalyzerReport: process.env.npm_config_report
  }
}
